<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的订单 / My Orders - 阿里宝宝</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/components.css">
    <link rel="stylesheet" href="css/responsive.css">
    <link rel="stylesheet" href="css/orders.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
    <!-- 头部 -->
    <header class="header">
        <div class="container">
            <div class="header-content">
                <!-- Logo -->
                <div class="logo">
                    <i class="fas fa-shopping-bag"></i>
                    <span>阿里宝宝</span>
                </div>
                
                <!-- 搜索框 -->
                <div class="search-box">
                    <input type="text" id="searchInput" placeholder="搜索商品... / Search products...">
                    <button id="searchBtn"><i class="fas fa-search"></i></button>
                </div>
                
                <!-- 用户菜单 -->
                <div class="user-menu">
                    <div class="user-info" id="userBtn">
                        <i class="fas fa-user"></i>
                        <span id="userName">登录 / Login</span>
                        <i class="fas fa-chevron-down"></i>
                    </div>
                    <div class="user-dropdown" id="userDropdown">
                        <a href="#" id="loginLink">登录 / Login</a>
                        <a href="#" id="registerLink">注册 / Register</a>
                        <a href="#" id="profileLink" style="display: none;">个人中心 / Profile</a>
                        <a href="#" id="ordersLink" style="display: none;">我的订单 / My Orders</a>
                        <a href="#" id="sellerLink" style="display: none;">卖家中心 / Seller Center</a>
                        <a href="#" id="logoutLink" style="display: none;">退出登录 / Login / Logout</a>
                    </div>
                </div>
                
                <!-- 购物车 / Shopping Cart -->
                <div class="cart-icon">
                    <i class="fas fa-shopping-cart"></i>
                    <span class="cart-count" id="cartCount">0</span>
                </div>
            </div>
        </div>
    </header>

    <!-- 导航栏 -->
    <nav class="nav">
        <div class="container">
            <ul class="nav-list">
                <li><a href="index.html" class="nav-link">首页 / Home</a></li>
                <li><a href="products.html?category=Food" class="nav-link">食品 / Food</a></li>
                <li><a href="products.html?category=Clothing" class="nav-link">服装 / Clothing</a></li>
                <li><a href="products.html?category=Book" class="nav-link">图书 / Books</a></li>
                <li><a href="products.html?category=Electronic" class="nav-link">电子产品</a></li>
                <li><a href="products.html?category=Daily" class="nav-link">日用品</a></li>
            </ul>
        </div>
    </nav>

    <!-- 主要内容 -->
    <main class="main">
        <div class="container">
            <div class="page-header">
                <h1><i class="fas fa-list-alt"></i>我的订单 / My Orders</h1>
                <div class="order-filters">
                    <button class="filter-btn active" data-status="all">全部订单</button>
                    <button class="filter-btn" data-status="Processing">待处理 / Processing</button>
                    <button class="filter-btn" data-status="Shipped">已发货 / Shipped</button>
                    <button class="filter-btn" data-status="Delivered">已送达 / Delivered</button>
                </div>
            </div>

            <!-- 订单列表 -->
            <div class="orders-container">
                <div id="ordersList" class="orders-list">
                    <!-- 订单列表将在这里动态生成 -->
                </div>
                
                <!-- 空状态 -->
                <div id="emptyOrders" class="empty-state" style="display: none;">
                    <i class="fas fa-shopping-bag"></i>
                    <h3>暂无订单</h3>
                    <p>您还没有任何订单，快去选购心仪的商品吧！</p>
                    <a href="index.html" class="btn btn-primary">去购物</a>
                </div>
                
                <!-- 加载状态 -->
                <div id="loadingOrders" class="loading-state">
                    <i class="fas fa-spinner fa-spin"></i>
                    <p>正在加载订单...</p>
                </div>
            </div>
        </div>
    </main>

    <!-- 订单详情模态框 -->
    <div id="orderDetailModal" class="modal">
        <div class="modal-content">
            <div class="modal-header">
                <h2>订单详情</h2>
                <span class="close" id="closeOrderDetail">&times;</span>
            </div>
            <div class="modal-body" id="orderDetailContent">
                <!-- 订单详情内容将在这里动态生成 -->
            </div>
        </div>
    </div>

    <!-- 认证模态框 -->
    <div id="authModal" class="modal">
        <div class="modal-content">
            <div class="modal-header">
                <h2 id="modalTitle">用户登录 / Login</h2>
                <span class="close" id="closeModal">&times;</span>
            </div>
            <div class="modal-body">
                <form id="authForm">
                    <div class="form-group">
                        <label for="username">用户名</label>
                        <input type="text" id="username" name="username" required>
                    </div>
                    <div class="form-group">
                        <label for="password">密码</label>
                        <input type="password" id="password" name="password" required>
                    </div>
                    <div class="form-group" id="emailGroup" style="display: none;">
                        <label for="email">邮箱</label>
                        <input type="email" id="email" name="email">
                    </div>
                    <div class="form-group" id="phoneGroup" style="display: none;">
                        <label for="phone">手机号</label>
                        <input type="tel" id="phone" name="phone">
                    </div>
                    <div class="form-group" id="shopNameGroup" style="display: none;">
                        <label for="shopName">店铺名称</label>
                        <input type="text" id="shopName" name="shopName">
                    </div>
                    <div class="form-group" id="userTypeGroup" style="display: none;">
                        <label for="userType">用户类型</label>
                        <select id="userType" name="userType">
                            <option value="Customer">买家</option>
                            <option value="Seller">卖家</option>
                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary" id="submitBtn">登录 / Login</button>
                </form>
                <div class="auth-switch">
                    <p id="switchText">还没有账号？<a href="#" id="switchLink">立即注册 / Register</a></p>
                </div>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <footer class="footer">
        <div class="container">
            <div class="footer-content">
                <div class="footer-section">
                    <h3>关于我们</h3>
                    <p>阿里宝宝电商平台，为您提供优质的商品和服务。</p>
                </div>
                <div class="footer-section">
                    <h3>客户服务</h3>
                    <ul>
                        <li><a href="#">帮助中心</a></li>
                        <li><a href="#">联系我们</a></li>
                        <li><a href="#">退换货政策</a></li>
                    </ul>
                </div>
                <div class="footer-section">
                    <h3>关注我们</h3>
                    <div class="social-links">
                        <a href="credits.html" class="credits-link"><i class="fab fa-weixin"></i></a>
                        <a href="credits.html" class="credits-link"><i class="fab fa-weibo"></i></a>
                        <a href="credits.html" class="credits-link"><i class="fab fa-qq"></i></a>
                    </div>
                </div>
            </div>
            <div class="footer-bottom">
                <p>&copy; 2024 阿里宝宝电商平台. All rights reserved.</p>
            </div>
        </div>
    </footer>

    <!-- 引入脚本 -->
    <script src="js/api.js"></script>
    <script src="js/auth.js"></script>
    <script src="js/cart.js"></script>
    <script src="js/orders.js"></script>
</body>
</html>
